package com.bawei.mvvmzonghe.datasource;

import com.bawei.mvvmzonghe.entity.BaseResponseEntity;
import com.bawei.mvvmzonghe.entity.CateGoryEntity;
import com.bawei.mvvmzonghe.entity.GoodsEntity;
import com.bawei.mvvmzonghe.net.Api;
import com.bawei.mvvmzonghe.net.RetrofitManager;

import java.util.List;

import androidx.lifecycle.LiveData;

/**
 * @Author : yaotianxue
 * @Time : On 2023/9/15 11:15
 * @Description : NetDataSource
 */
public class NetDataSource {
    private Api mApi;
    public NetDataSource() {
        mApi = RetrofitManager.getInstance().getRetrofit().create(Api.class);
    }
    //分类
    public LiveData<BaseResponseEntity<List<CateGoryEntity>>> type(int type){
        return mApi.type(type);
    }

    //商品
    public LiveData<BaseResponseEntity<GoodsEntity>> goods(int id, int page, int size){
        return mApi.goods(id,page,size);
    }
}
